package com.zzs.restweb.utils.enums;

public enum SexTypeEnum {
    MALE(0, "男性"),
    FEMALE(1, "女性"),
    UNKNOWN(2, "未知");

    private Integer code;
    private String description;

    public static SexTypeEnum getEnumByCode(Integer code) {
        for (SexTypeEnum e : SexTypeEnum.values()) {
            if (!e.getCode().equals(code)) {
                continue;
            }
            return e;
        }
        return null;
    }

    public Integer getCode() {
        return this.code;
    }

    public String getDescription() {
        return this.description;
    }

    SexTypeEnum(Integer code, String description) {
        this.code = code;
        this.description = description;
    }
}